﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using NHibernate.Criterion;

namespace Bizbase.Repository
{
    public interface IRepository<TEntity> : IDisposable
    {
        TEntity Save(TEntity entity);
        void Update(TEntity entity);
        TEntity SaveOrUpdate(TEntity entity);
        void Delete(TEntity entity);
        TEntity Get(object id);
        IList<TEntity> FindAll();
        IList<TEntity> Find(string propertyName, object value);

        IList<TEntity> Find(params ICriterion[] criteria);
        IList<TEntity> Find(Order[] orders, params ICriterion[] criteria);
        IList<TEntity> Find(int firstResult, int numberOfResults, Order[] selectionOrder, params ICriterion[] criteria);
    }
}
